package cn.lxh.ymcc.feign.impl;

import cn.lxh.ymcc.domain.User;
import cn.lxh.ymcc.feign.UserFeignClient;
import feign.hystrix.FallbackFactory;
import org.apache.catalina.Group;
import org.apache.catalina.Role;

import org.apache.catalina.UserDatabase;
import org.springframework.stereotype.Component;

import java.util.Iterator;

@Component
public class UserFeignClientFallBackFactory implements FallbackFactory<UserFeignClient> {

    @Override
    public UserFeignClient create(Throwable throwable) {
        return new UserFeignClient() {
            @Override
            public User selectByPhone(String phone) {
                throwable.printStackTrace();
             return new User(-1L,-1L,-1L,"豪猪","豪猪","豪猪","豪猪",-1,1,-1L);
            }
        };
    }
}
